// !@#$McCaBe-InStRuMeNtAtIoN$#@!
// Instrumented with the McCabe Java Parser
// Version: 8.1.0.1 - 20110309
// Using Path Vector Instrumentation
// Date: Sun Apr 01 2012 20:41:25
package Model;

import java.text.SimpleDateFormat;

import com.mccabe.*;


class Booking_a6f4194875cac8541ff94eee33973606 {
    static java.lang.Object info[];
    static {
        info = new java.lang.Object[2];
        info[0] = new Integer(-1);
        info[1] = new String("R:\\yu\\Concordia\\SOEN 344 Design II\\Term Assignment\\Code Repo\\trunk\\Iteration 3\\ERS\\src\\Model\\Booking.java");
    }
}


/**
 * A booking of a person to a seat at an event
 * @author Yury Kitaev
 *
 */
public class Booking 
{
	private Person person;
	private Event event;
	private Seat seat;
	
	public Booking(Person person, Event event, Seat seat)
	{
		super();
int _mcFreq_55495fe670c65ffacd184c81c25149cd[] = PathVec_ERS_Iter3.getIntArray(0);
PathVec_ERS_Iter3.releaseIntArray();
PathVec_ERS_Iter3.enterConstructorWithECC(Booking_a6f4194875cac8541ff94eee33973606.info,0,_mcFreq_55495fe670c65ffacd184c81c25149cd,0);

		this.person = person;
		this.event = event;
		this.seat = seat;
		this.seat.setTaken(true);
	}

	public Person getPerson() 
	{
int _mcFreq_799350caf51e1d978c89f480e0affd5c[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Booking_a6f4194875cac8541ff94eee33973606.info,1,_mcFreq_799350caf51e1d978c89f480e0affd5c,0);

		return person;
	}

	public void setPerson(Person person)
	{
int _mcFreq_c46443d9d277371094b8d07a9f04becf[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Booking_a6f4194875cac8541ff94eee33973606.info,2,_mcFreq_c46443d9d277371094b8d07a9f04becf,0);

		this.person = person;
	}

	public Event getEvent() 
	{
int _mcFreq_31229c838fd6efa6829d06030cd97464[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Booking_a6f4194875cac8541ff94eee33973606.info,3,_mcFreq_31229c838fd6efa6829d06030cd97464,0);

		return event;
	}

	public void setEvent(Event event) 
	{
int _mcFreq_d4b71c8829affae40c62db304afe3ae6[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Booking_a6f4194875cac8541ff94eee33973606.info,4,_mcFreq_d4b71c8829affae40c62db304afe3ae6,0);

		this.event = event;
	}

	public Seat getSeat() 
	{
int _mcFreq_6eeda20615c572126ccce1dc775218b7[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Booking_a6f4194875cac8541ff94eee33973606.info,5,_mcFreq_6eeda20615c572126ccce1dc775218b7,0);

		return seat;
	}

	public void setSeat(Seat seat) 
	{
int _mcFreq_210f12c9feabdb84f5f30d01f2d09aa0[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Booking_a6f4194875cac8541ff94eee33973606.info,6,_mcFreq_210f12c9feabdb84f5f30d01f2d09aa0,0);

		this.seat = seat;
	}

	@Override
	public String toString() 
	{
int _mcFreq_7267046a0e508ee65e1b902ef59ca130[] = new int[1];
PathVec_ERS_Iter3.enterMethod(Booking_a6f4194875cac8541ff94eee33973606.info,7,_mcFreq_7267046a0e508ee65e1b902ef59ca130,0);

		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		return getPerson().toString().toUpperCase() + " booked for " + getEvent().getSpecification().getTitle() + " on " + format.format(getEvent().getDate()) + ", seat #" + getSeat().getNumber();
	}
	
	
}
